<?php
/**
 * View a bookmark
 *
 * @package ElggBookmarks
 */

gatekeeper();

elgg_set_context('owner');
elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());

$golf_score = elgg_get_golf_score(array(
		'golf_score_id' => get_input('golf_score_id'),
		'active_flg' => 1,
	));
$golf_score = $golf_score[0];
if (!$golf_score) {
// 	register_error(elgg_echo('noaccess'));
// 	$_SESSION['last_forward_from'] = current_page_url();
// 	forward('');
	$golf_score = elgg_echo('golf_score:none');
}
// $page_owner = elgg_get_page_owner_entity();
elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());

elgg_push_breadcrumb($page_owner->name);

$title = elgg_echo('golfscore:view');

$default = array (
			'title' => $title,
			'score' => $golf_score,
		);
$body = "<div class='viewscore_dt'>";
$body .= elgg_view('object/golfscore', $default);
$body .= "</div>";
//$body = elgg_view('golfscore/form', $default);

$params = array(
			'content' => $body,
			'nav' => '',
		);
$body = elgg_view_layout('one_column', $params);
echo elgg_view_page($title, $body);
// echo $body;
return true;